*/
/** */
-$oldCwd = getcwd();
-
-$optionsWithArgs = array( "o" );
-include_once( "commandLine.inc" );
/**
* @todo document
}
function getRebuildInterwikiSQL() {
- global $langlist, $languageAliases;
+ global $langlist, $languageAliases, $wgDBname;
# Initialise lists of wikis
$sites = array(
'wiki' => new Site( 'wiki', 'w', 'wikipedia.org' ),
'wiktionary' => new Site( 'wiktionary', 'wikt', 'wiktionary.org' ),
'wikiquote' => new Site( 'wikiquote', 'q', 'wikiquote.org' ),
- 'wikibooks' => new Site( 'wikibooks', 'b', 'wikibooks.org' )
+ 'wikibooks' => new Site( 'wikibooks', 'b', 'wikibooks.org' ),
+ 'wikinews' => new Site( 'wikinews', 'n', 'wikinews.org' ),
);
$langlist = array_map( "trim", file( "/home/wikipedia/common/langlist" ) );
$dblist = array_map( "trim", file( "/home/wikipedia/common/all.dblist" ) );
'zh-cn' => 'zh',
'zh-tw' => 'zh',
'dk' => 'da',
+ 'nb' => 'no',
);
# Construct a list of reserved prefixes
}
# Extract the intermap from meta
- $dbr =& wfGetDB( DB_WRITE );
- $row = $dbr->selectRow( "metawiki.cur", array( "cur_text" ),
- array( "cur_namespace" => 0, "cur_title" => "Interwiki_map" ) );
+ $lines = file( 'http://meta.wikimedia.org/w/index.php?title=Interwiki_map&action=raw' );
- if ( !$row ) {
+ if ( !$lines ) {
die( "m:Interwiki_map not found" );
}
- $lines = explode( "\n", $row->cur_text );
$iwArray = array();
foreach ( $lines as $line ) {
}
if ( empty( $reserved[$prefix] ) ) {
- $iwArray[] = array( "iw_prefix" => $prefix, "iw_url" => $url, "iw_local" => $local );
+ $iwArray[$prefix] = array( "iw_prefix" => $prefix, "iw_url" => $url, "iw_local" => $local );
}
}
}
} else {
$sql .= ",\n";
}
- $sql .= "(" . Database::makeList( $entry ) . ")";
+ $dbr =& wfGetDB( DB_SLAVE );
+ $sql .= "(" . $dbr->makeList( $entry ) . ")";
return $sql;
}